﻿using System;
using HK.Core.Common.Data;
using HK.Editor.GUIEx.Protocol.TreeView.Data;

namespace HK.Editor.GUIEx.Protocol.TreeView.Control
{
    /// <summary>
    /// 接口 : 树形Row
    /// </summary>
    public interface ITreeViewRow<TBranch> where TBranch : JsonData, ITreeBranch 
    {
        /// <summary>
        /// 数据
        /// </summary>
        TBranch Data { get; set; }

        /// <summary>
        /// 排序子节点
        /// </summary>
        /// <param name="iSelector">排序选择器</param>
        /// <param name="iAscending">true:升序; false:降序;</param>
        /// <typeparam name="TBranch">树枝类型</typeparam>
        /// <typeparam name="TKey">Key</typeparam>
        void SortChildren<TKey>(Func<ITreeViewRow<TBranch>, TKey> iSelector, bool iAscending);
    }
}
